//
//  QLBxOrderCostMidCell.m
//  Xiaomakuaixiu
//
//  Created by 龚碧容 on 2017/10/23.
//  Copyright © 2017年 hwd. All rights reserved.
//

#import "QLBxOrderCostMidCell.h"

@implementation QLBxOrderCostMidCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    // Configure the view for the selected state
}

+ (instancetype)cellWithTableView:(UITableView *)tableView{
    
    static NSString *identifiew=@"QLBxOrderCostMidCellId";
    QLBxOrderCostMidCell *cell=[tableView dequeueReusableCellWithIdentifier:identifiew];
    if (cell==nil) {
        cell=[[[NSBundle mainBundle] loadNibNamed:@"QLBxOrderCostMidCell" owner:nil options:nil] firstObject];
        
        CGFloat lOrighX1 = 0;
        CGFloat lOrighX2 = 30;
        CGFloat lOrighX3 = 140;
        CGFloat lOrighX4 = kScreen_width-140;
        CGFloat lOrighX5 = kScreen_width-100;
        CGFloat lOrighX6 = kScreen_width-50;
        
        NSArray *hXArray=[NSArray arrayWithObjects:@(lOrighX1),@(lOrighX2),@(lOrighX3),@(lOrighX4),@(lOrighX5),@(lOrighX6), nil];
        NSArray *widthArray=[NSArray arrayWithObjects:@(30),@(110),@(kScreen_width-280),@(40),@(50),@(50),nil];
        
        for (int i=0; i<6; i++) {
            CGFloat tmpOriginX=[hXArray[i] floatValue];
            CGFloat tmpwidth=[widthArray[i] floatValue];
            
            if (i==1||i==3) {
                UIView *backView=[[UIView alloc] initWithFrame:CGRectMake(tmpOriginX+5, 5, tmpwidth-10, 34)];
                backView.backgroundColor=UIColorFromRGB(0xf9f9f9);
                [cell addSubview:backView];
            }
            
            UILabel *aTipLabel=[[UILabel alloc] initWithFrame:CGRectMake(tmpOriginX, 0, tmpwidth, 44)];
            aTipLabel.font=[UIFont systemFontOfSize:14];
            aTipLabel.textColor=[UIColor darkGrayColor];
            aTipLabel.numberOfLines=0;
            aTipLabel.backgroundColor=[UIColor clearColor];
            aTipLabel.textAlignment=NSTextAlignmentCenter;
            [cell addSubview:aTipLabel];
            
            switch (i) {
                case 0:
                    cell.peijianIdLabel=aTipLabel;
                    break;
                case 1:
                    cell.serialNoLabel=aTipLabel;
                    break;
                case 2:
                    cell.peijianNameLabel=aTipLabel;
                    break;
                case 3:
                    cell.peijianNumLabel=aTipLabel;
                    break;
                case 4:
                    cell.peijianPriceLabel=aTipLabel;
                    break;
                case 5:
                    cell.vipPriceLabel=aTipLabel;
                    break;
                default:
                    break;
            }
            
            if (i!=0) {
                UIView *line1=[[UIView alloc] initWithFrame:CGRectMake(tmpOriginX-0.5,0,0.5,44)];
                line1.backgroundColor=[UIColor lightGrayColor];
                [cell addSubview:line1];
            }
        }
        
    }
    return cell;
}

@end
